package com.example.pmxt.modules.carousel;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.pmxt.domain.Carousel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;


@Mapper
public interface CarouselMapper extends BaseMapper<Carousel> {

    //全文检索
    @Select("select * from sys_carousel where id like concat(#{input},'%') or name like concat(#{input},'%')  or introduction like concat(#{input},'%');")
    List<Carousel> selectByInput(@Param("input") String input);

    //查询全部
//    @Select("select * from sys_carousel;")
//    List<Carousel> selectAll();

    //逻辑删除轮播图
    @Update("UPDATE sys_carousel SET deleteflag = 1 WHERE id = #{id};")
    int delete(Integer id);
}
